<?php
namespace App\Api\Transformers;


use App\MasterVideo;
use League\Fractal\TransformerAbstract;

class MasterVideoTransformer extends TransformerAbstract
{
    /**
     * @param MasterVideo $mvideo
     * @return array
     */
    public function transform(MasterVideo $mvideo)
    {
        $videoUrl = "http://yuejian.app/uploads/videos/";
        $avatarUrl = "http://yuejian.app/uploads/avatars/";
        return [
            'mvideo_id' => $mvideo['id'],
            'mvideo_name' => $mvideo['video_name'],
            'mvideo_intro' => $mvideo['video_intro'],
            'mvideo_pic' => $avatarUrl.$mvideo['video_pic'],
            'mvideo' => $videoUrl.$mvideo['video_address'],
        ];
    }
}